const BASE_SERVER_URL='http://192.168.64.3'

const get=(url,params)=>{
  return new Promise((resolve,reject)=>{
    wx.request({
      url: BASE_SERVER_URL+url, //仅为示例，并非真实的接口地址
      data: params,
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 默认值
      },
      success (res) {
        resolve(res.data)
      },
      fail(res){
        reject(res)
      }
    })
  })
 


}

const post=(url,params)=>{
  return new Promise((resolve,reject)=>{
    wx.request({
      url: BASE_SERVER_URL+url, //仅为示例，并非真实的接口地址
      data: params,
      method:'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded' // 默认值
      },
      success (res) {
        resolve(res.data)
      },
      fail(res){
        reject(res)
      }
    })
})
}


module.exports ={
  get,
  post
}